<style>
input {width:500px;}
.ctitulo {
	color:#000000; 
	font-weight:bold; 
	font-size:12px;
	padding-right:10px;
	text-align:right;
	min-width:100px;
}
</style>


	<div class="form-group">
		<label class="col-sm-2 control-label" for="Titulo">Título:</label>
		<div class="col-sm-8">
			<input type='text'  name='data[titulo]' id="Titulo" maxlength='160' required value="<?php echo $Pub['titulo'];?>" class="form-control" onblur="arma_url_friendly();"/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="urlamigable">URL Amigable:</label>
		<div class="col-sm-8">
			<input type='text'  name='data[urlamigable]' id="urlamigable" maxlength='160' value="<?php echo $Pub['urlamigable'];?>" class="form-control"/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="keywords">Palabras Claves:</label>
		<div class="col-sm-8">
			<input type='text'  name='data[keywords]' id="keywords" maxlength='160'	value="<?php echo $Pub['urlamigable'];?>" class="form-control"/>
		</div>
	</div>
		
	<div class="form-group">
		<label class="col-sm-2 control-label" for="descripcion">Meta Description:
		<span class="help-block">máx.200 caracteres.</span></label>
		<div class="col-sm-8">
			<textarea name='data[descripcion]' id='descripcion' class="form-control" rows='3'><?php echo $Pub['descripcion'];?></textarea>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-4 control-label" for="fecha">Fecha de la publicacion:</span></label>
		<div class="col-sm-6"><?php echo cb_fechas($fecha);?></div>
	</div>
		

	<div class="form-group">
		<label class="col-sm-4 control-label" for="lecturas">Contador de visitas:</label>
		<div class="col-sm-5">
			<input type='number'  name='data[lecturas]' id="lecturas" value="<?php echo $Pub['lecturas'];?>" class="form-control" style='width:100px;'/>
		</div>
	</div>

<script>	
    function arma_url_friendly(){
        var titulo = $('#Titulo').val();
        url_amigable  = titulo.toLowerCase();
        url_amigable  = url_amigable.replace(/[ ]/gi,'-');
        url_amigable  = url_amigable.replace(/[á]/gi,'a');
        url_amigable  = url_amigable.replace(/[é]/gi,'e');
        url_amigable  = url_amigable.replace(/[í]/gi,'i');
        url_amigable  = url_amigable.replace(/[ó]/gi,'o');
        url_amigable  = url_amigable.replace(/[ú]/gi,'u');
        url_amigable  = url_amigable.replace(/[ñ]/gi,'n');
        url_amigable  = url_amigable.replace(/[,]/gi,'-');
        url_amigable  = url_amigable.replace(/[;]/gi,'-');
        url_amigable  = url_amigable.replace(/[.]/gi,'-');
        url_amigable  = url_amigable.replace(/[?]/gi,'-');
        url_amigable  = url_amigable.replace(/[¿]/gi,'-');
        url_amigable  = url_amigable.replace(/[!]/gi,'-');
        url_amigable1 = url_amigable.replace(/[----]/gi,'-');
        url_amigable2 = url_amigable1.replace(/[---]/gi,'-');
        url_amigable  = url_amigable2.replace(/[--]/gi,'-');
        
        $("#urlamigable").val(url_amigable);
    }

</script>	